<!DOCTYPE html>
<html>
    <head>
        <script>
            var myname = prompt('请输入姓名');
            alert('你输入的姓名是: ' + myname);
            console.log('你输入的姓名是：' + myname);
        </script>
    </head>
    <body>

    </body>
</html>